﻿using System;
using System.Linq;
using CsvHelper.Configuration;

namespace AIC_Notification
{
    public class School
    {
        public string ID { get; set; }
        public string Name { get; set; }
        public string Country { get; set; }
        public string Type { get; set; }
        public int RankingInt { get; set; }
        public string Ranking { get; set; }
        public string ShortName { get; set; }
        public string TranslatedName { get; set; }
        public string NonSupplimentText { get; set; }
        public SchoolAdmissionStatistics AdmissionResultObj = null;

        public School()
        {
            Name = "";
            Country = "";
            Type = "";
            Ranking = "";
            ShortName = "";
        }

        public bool NonSuppliment()
        {
            return NonSupplimentText == "1" ? true : false;
        }
    }

    public sealed class SchoolMap : ClassMap<School>
    {
        public SchoolMap()
        {
            Map(m => m.ID).Index(0);
            Map(m => m.Name).Index(1);
            Map(m => m.ShortName).Index(2);
            Map(m => m.Type).Index(3);
            Map(m => m.Ranking).Index(4);
            Map(m => m.TranslatedName).Index(5);
            Map(m => m.Country).Index(6);
            Map(m => m.NonSupplimentText).Index(7);
        }
    }
}
